package com.wn.controller;

import com.wn.bean.MenuVo;
import com.wn.common.Result;
import com.wn.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yellow Docter
 * @date 2024-07-08
 * @desc 蜗牛创想：www.woniuxy.com
 */
@RestController
public class MenuController {

    @Autowired
    private IMenuService iMenuService;

    @GetMapping("/menu")
    public Result<List<MenuVo>> getMenu(String name){
        List<MenuVo> menuVos = iMenuService.queryMenuByUsername(name);
        return Result.ok(menuVos);
    }

}
